//定义测试系统详细信息表单的基类
Ext.define('testSystemFormBase',{
	 extend: 'Ext.form.Panel',
	 header:false,
	    bodyPadding: 10,
	    border:false,
	    defaults: {
	        anchor: '100%',
	        layout: 'column', //默认定义组件内部元素为布局为列布局方式
	        border: false
	    },
	    items: [{
	        defaults: {
	            border: false,
	            layout: 'form',
	        },
	        items: [{
	            columnWidth: .5, //该列占用的宽度，标识为50％
	            items: [{
	                xtype: 'textfield',
	                labelWidth: 50,
	                allowBlank: false,
	                fieldLabel: '系统名称',
	                name: 'name',
	                emptyText: '限制字数',
	                itemId: 'name'
	            }]
	        }, {
	            columnWidth: .5,
	            items: [{
	                xtype: 'combo',
	                fieldLabel: '类型',
	                allowBlank: false,
	                labelWidth: 50,
	                editable: false,//防止用户直接在下拉框里输入
	                itemId: 'type',
	                emptyText: '选择系统类型',
	                store: testSystemTypeStore,
	                queryMode: 'local',
	                displayField: 'typeName',
	                valueField: 'typeNum',
	            }]
	        }]
	    }, {
	        defaults: {
	            border: false,
	            layout: 'form',
	            margin:'20 0 0 0'
	        },
	        items: [{
	            columnWidth: .5, //该列占用的宽度，标识为50％
	            items: [{
	                xtype: 'displayfield',
	                labelWidth: 50,
	                fieldLabel: '添加人',
	                itemId: 'addMan',
	                renderer:function(value){
	        			return value==""||null?'不详':value;
	        		}
	            }]
	        }, {
	            columnWidth: .5,
	            items: [{
	                xtype: 'displayfield',
	                labelWidth: 50,
	                fieldLabel: '开发者',
	                itemId: 'devMan',
	                renderer:function(value){
	        			return value==""||null?'不详':value;
	        		}
	            }]
	        }]
	    }, {
	        defaults: {
	            border: false,
	            layout: 'form',
	            margin:'20 0 0 0'
	        },
	        items: [{
	            columnWidth: .5, //该列占用的宽度，标识为50％
	            items: [{
	                xtype: 'displayfield',
	                fieldLabel: '创建时间:',
	                labelWidth: 70,
	                itemId: 'createDate'
	            }]
	        }, {
	            columnWidth: .5,
	            items: [{
	                xtype: 'displayfield',
	                fieldLabel: '最近更新:',
	                labelWidth: 70,
	                itemId: 'updateDate'
	            }]
	        }]
	    }, {
	    	fieldLabel: '描述信息',
	    	margin:'20 0 0 5',
	    	allowBlank: false,
	    	labelWidth: 70,
	        xtype: 'textareafield',
	        height:'65%',
	        itemId: 'describe',
	        cls: 'x-form-valid',
	        emptyText: '填写描述信息'
	    }],
	    constructor: function () {
	        this.callParent(arguments); // 调用父类的构造函数,不然会报错
	        this.pattern=arguments[0];//判断这个是哪一个模式
	        this.down('#name').setReadOnly(this.pattern==0||this.pattern==2);
	        this.down('#type').setReadOnly(this.pattern==0||this.pattern==2);
	        this.down('#describe').setReadOnly(this.pattern==0||this.pattern==2);
	    }
});